package main.java.com.silence.pojo;

import java.util.Date;

/**
 * Author: silence
 * Date: 17-6-2
 */
public class Bill {
    /** id */
    private Integer id;

    /** 金额 */
    private Float money;

    /** 标题 */
    private String title;

    /** 拥有者 */
    private Integer owner;

    /** 描述 */
    private String introduce;

    /** 类型 1:收入 2:支出 */
    private BillType type;

    /** 产生时间 */
    private Date createDate;

    /** empty constructor */
    public Bill() {
    }

    @Override
    public String toString() {
        return "Bill{" +
                "id=" + id +
                ", money=" + money +
                ", title='" + title + '\'' +
                ", owner=" + owner +
                ", introduce='" + introduce + '\'' +
                ", type=" + type +
                ", createDate=" + createDate +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Bill bill = (Bill) o;

        if (id != null ? !id.equals(bill.id) : bill.id != null) return false;
        if (money != null ? !money.equals(bill.money) : bill.money != null) return false;
        if (title != null ? !title.equals(bill.title) : bill.title != null) return false;
        if (owner != null ? !owner.equals(bill.owner) : bill.owner != null) return false;
        if (introduce != null ? !introduce.equals(bill.introduce) : bill.introduce != null) return false;
        if (type != null ? !type.equals(bill.type) : bill.type != null) return false;
        return createDate != null ? createDate.equals(bill.createDate) : bill.createDate == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (owner != null ? owner.hashCode() : 0);
        result = 31 * result + (introduce != null ? introduce.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Float getMoney() {
        return money;
    }

    public void setMoney(Float money) {
        this.money = money;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getOwner() {
        return owner;
    }

    public void setOwner(Integer owner) {
        this.owner = owner;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public BillType getType() {
        return type;
    }

    public void setType(BillType type) {
        this.type = type;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
}
